#ifndef BPF_MAP__H
#define BPF_MAP__H

#include <bpf/libbpf.h>
#include <bpf/bpf.h>

int update_sub2role(int map_fd, subject_t *sub, role_t *role)
{
    return bpf_map_update_elem(map_fd, sub, role, BPF_ANY);
}

int update_wholefilepolicy(int map_fd, u64 *f_ino, file_policy_val_t *val)
{
    return bpf_map_update_elem(map_fd, f_ino, val, BPF_ANY);
}

int update_filepolicy(int map_fd, file_policy_key_t *key, file_policy_val_t *val)
{
    return bpf_map_update_elem(map_fd, key, val, BPF_ANY);
}

int update_wholefspolicy(int map_fd, u32 s_dev, file_policy_val_t *val)
{
    return bpf_map_update_elem(map_fd, &s_dev, val, BPF_ANY);
}

int update_fspolicy(int map_fd, fs_policy_key_t *key, file_policy_val_t *val)
{
    return bpf_map_update_elem(map_fd, key, val, BPF_ANY);
}

int update_netpolicy(int map_fd, net_policy_key_t *key, net_policy_val_t *val)
{
    return bpf_map_update_elem(map_fd, key, val, BPF_ANY);
}

int update_wholenetpolicy(int map_fd, u32 key, net_policy_val_t *val)
{
    return bpf_map_update_elem(map_fd, &key, val, BPF_ANY);
}

#endif // !BPF_MAP__H
